package com.imti.mall.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.imti.mall.model.cms.pojo.CmsSubjectProductRelation;
import com.imti.mall.model.pms.pojo.PmsMemberPrice;
import com.imti.mall.product.dao.CmsSubjectProductRelationDao;
import com.imti.mall.product.dao.PmsMemberPriceDao;
import com.imti.mall.product.service.CmsSubjectProductRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CmsSubjectProductRelationServiceImpl extends ServiceImpl<CmsSubjectProductRelationDao, CmsSubjectProductRelation> implements CmsSubjectProductRelationService {
    @Autowired
    CmsSubjectProductRelationDao cmsSubjectProductRelationDao;
    /**
     * 根据商品id查询专题商品关系表
     * @param id
     * @return
     */
    @Override
    public List<CmsSubjectProductRelation> getCmsSubjectProductRelationProductId(Integer id) {
        return cmsSubjectProductRelationDao.getCmsSubjectProductRelationProductId(id);
    }
    /**
     * 添加优选专题商品关系表
     * @param cmsSubjectProductRelation
     * @return
     */
    @Override
    public Integer addCmsSubjectProductRelation(CmsSubjectProductRelation cmsSubjectProductRelation) {
        return cmsSubjectProductRelationDao.insert(cmsSubjectProductRelation);
    }

    @Override
    public boolean addList(List<CmsSubjectProductRelation> list) {
        return saveBatch(list);
    }

    @Override
    public boolean updateList(List<CmsSubjectProductRelation> list) {
        return saveOrUpdateBatch(list);
    }

    @Override
    public boolean deleteList(List<CmsSubjectProductRelation> list) {
        return removeByIds(list);
    }


}
